﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace suirui.ZhuMu.Framework
{
    public class UserModel
    {
        public long Id { get; set; }
        public string Email { get; set; }
        public string UserName { get; set; }

        public IEnumerable<Userrefreshtoken> UserRefreshTokens => TokenValidate._userRefreshTokens;
    }

    public class Userrefreshtoken
    {
        public long Id { get; set; }
        public string Token { get; set; }
        public DateTime Expires { get; set; }
        public string UserId { get; set; }
        public bool Active
        {
            get { return DateTime.Now <= Expires; }
            set { }
        }
    }

    public class Response
    {
        public string accessToken { get; set; }
        public string refreshToken { get; set; }
        /// <summary>
        /// 10位的时间戳
        /// </summary>
        public long timespan { get; set; }
        /// <summary>
        /// MD5(phone=""&Password=""&timespan=&key=abcdefghijklmnopqrstuvwxyz)
        /// </summary>
        public string sign { get; set; }
    }
}
